import { ResPage, CommandTree, ObjectTree, Control, ResultData } from "@/api/interface/index";
import http from "@/api";
/**
 * @name 设备控制模块
 */
// 获取柜体列表
export const getCommandTree = (params: CommandTree.ReqCommandTreeParams) => {
  return http.post<CommandTree.ResCommandTree>(`/electcollect/control/dataTree`, params);
};
// 获取操作对象列表
export const getObjectTree = (params = {}) => {
  return http.post<ResPage<ObjectTree.ResObjectTree>>(`/electcollect/control/objectList`, params);
};

/**
 * @name 柜体控制模块
 */
// 柜体控制
export const cabinetControl = (params: Control.ReqControlParams) => {
  return http.post<ResultData>(`/electcollect/control/device`, params, {}, { noTips: true });
};
/**
 * @name 工位控制模块
 */
// 工位控制
export const stationControl = (params: Control.ReqControlParams) => {
  return http.post<ResultData>(`/electcollect/control/station`, params, {}, { noTips: true });
};
/**
 * @name 终端控制模块
 */
// 终端控制
export const terminalControl = (params: Control.ReqControlParams) => {
  return http.post<ResultData>(`/electcollect/control/term`, params, {}, { noTips: true });
};
/**
 * @name 电表控制模块
 */
// 电表控制
export const meterControl = (params: Control.ReqControlParams) => {
  return http.post<ResultData>(`/electcollect/control/meter`, params, {}, { noTips: true });
};
/**
 * @name 工位控制模块
 */
// 电源控制
export const powerControl = (params: Control.ReqControlParams) => {
  return http.post<ResultData>(`/electcollect/control/power`, params, {}, { noTips: true });
};
